/*******************************************************************************
 * Package: com.song.boot.springstudy.myspring.processor
 * Type:    MyBeanPostProcessor
 * Date:    2025/5/13 14:39
 *
 * Copyright (c) 2025 LTD All Rights Reserved.
 *
 * You may not use this file except in compliance with the License.
 *******************************************************************************/
package com.song.boot.springstudy.myspring.processor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * 功能描述：Spring 容器会把每个 Bean 依次传递给 BeanPostProcessor 进行处理
 *https://blog.csdn.net/xiaofeng10330111/article/details/130190804
 * @author Songxianyang
 * @date 2025/5/13 14:39
 */
// @Component
@Slf4j
public class MyBeanPostProcessor implements BeanPostProcessor {
    /**
     * @param bean
     * @param beanName
     * @return
     * @throws BeansException
     */
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        log.info("postProcessBeforeInitialization: songBean::::{}",beanName);
        return bean;
    }
}
